package com.yusys.pattern.mode.visitor;

import com.yusys.pattern.mode.visitor.observerson.BinaryObserver;
import com.yusys.pattern.mode.visitor.observerson.OctalObserver;

public class ObserverPatternDemo {

    public static void main(String[] args) {
        Subject subject = new Subject();

        // 被观察对象subject 的第一个观察者
        new BinaryObserver(subject);

        new OctalObserver(subject);

        System.err.println("first state change:"+15);
        subject.setState(15);

        System.err.println("second state change:"+28);
        subject.setState(28);

    }
}
